<template>
  <div class="hot-goods">
    <h2>论坛热评</h2>
    <div class="container">
      <div class="wrapper">
        <div class="item" v-for="(item,index) in Items" :key="index"
            :class="{active: index === selected}"
            @mouseenter="selected = index" @mouseleave="selected = ''"
          >
          <a :href="item.link">
            <img :src="item.imgUrl">
          </a>
          <div class="content">
            <div class="commit">
              <p class="text">{{item.text}}</p>
              <p class="source">{{item.source}}</p>
            </div>
            <div class="info">
              <p class="title">{{item.title}}</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      selected: '',
      Items: [
        {title: '北京大学', text: '北大的篮球场环境真好！！而且人也多，真是锻炼的好地方', source: '来自于 乃0 的评价', imgUrl: './static/img/BD2.jpg', link: 'https://www.mi.com/capsuleearphone/'},
        {title: '河北地质大学', text: '为什么宿舍还不安空调！！', source: '来自于 在读大一的新生 的评价', imgUrl: './static/img/hbdzdxss.jpg', link: 'https://www.mi.com/miwifi3/'},
        {title: '清华大学', text: '去过这么多地方还是觉得清华的环境最好', source: '来自于 毕业多年的老学长 的评价', imgUrl: './static/img/QH2.jpg', link: 'https://www.mi.com/micamera/'},
        {title: '上海交通大学', text: '学校的CUBA在慢慢变强呢', source: '来自于 cuba现役球员 的评价', imgUrl: './static/img/sjd.jpg', link: 'https://www.mi.com/water/'},
      ]
    }
  }
}
</script>

<style lang="scss" scoped>
.hot-goods{
  width: 1226px;
  margin: 0 auto;
  background: #f5f5f5;
  padding-top: 60px;
  h2{
    font-size: 22px;
    font-weight: 200;
    line-height: 58px;
    color: #333;
  }
  .container{
    width: 1226px;
    margin: 0 auto;
    .wrapper{
      display: flex;
      justify-content: space-between;
      align-content: space-between;
      .active{
        box-shadow: 0 15px 30px rgba(0,0,0,0.1);
        margin-top: -1px;
        transition: all .2s linear;
      }
      .item{
        position: relative;
        overflow: hidden;
        width: 296px;
        height: 415px;
        background: #fff;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        text-align: center;
        >a>img{
          width: 296px;
          height: 220px;
        }
        .content{
          height: 190px;
          width: 240px;
          display: flex;
          flex-direction: column;
          justify-content: flex-start;
          align-items: center;
          color: #333;
          .commit{
            text-align: left;
            margin: 28px 0 15px 0;
            width: 240px;
            .text{
              font-size: 14px;
              font-weight: 400;
              line-height: 24px;
              height: 72px;
            }
            .source{
              color: #b0b0b0;
              margin: 22px 0 0 0;
            }
          }
          .info{
            display: flex;
            width: 240px;
            align-items: center;
            .title{
              font-size: 14px;
              font-weight: 400;
              padding-right: 10px;
              border-right: 2px solid #e0e0e0;
            }
            .price{
              color: #ff6709;
              padding-left: 10px;
              font-size: 14px;
            }
          }
        }
      }
    }
  }
}
</style>
